package aibili.ronaldo.utils;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BCryptPasswordEncoderUtils {
    private static BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
    public static String encode(String password){
        return bCryptPasswordEncoder.encode(password);
    }
    public static boolean matches(CharSequence rawPassword, String encodedPassword){
        return bCryptPasswordEncoder.matches(rawPassword, encodedPassword);
    }

    public static void main(String[] args) {
        String password = "123456";
        String pwd = encode(password);
        System.out.println(pwd);
    }
}
